package TOOLS.AKtable;

import java.util.HashMap;
import java.util.Map;

public class m_row {
	int id;
	Map<String,Object> data;
	boolean flag4select=true;
	
	public m_row() {
		data=new HashMap<String, Object>();
	}
	
	public Object put(String key, Object value) {
		return data.put(key, value);
	}
	
	public Object get(String key) {
		return data.get(key);
	}
	
	public int size() {
		return data.size();
	}
	
	public m_row clone() {
		m_row nRow=new m_row();
		nRow.id=id;
		nRow.flag4select=flag4select;
		for (Map.Entry<String, Object> entry : data.entrySet()) {
			nRow.data.put(entry.getKey(), entry.getValue());
		}
		return nRow;
	}
	
	public String toString() {
		String result="---\t\t";
		String iTytle,iData;
		iTytle="---\t\t";
		iData=""+id+"\t\t";
		int k=0;
		for (Map.Entry<String, Object> entry : data.entrySet()) {
			if(k>0) {
				iTytle=iTytle+"\t";
				iData=iData+"\t";
			}
			iTytle=iTytle+entry.getKey();
			iData=iData+entry.getValue();
			k+=1;
		}
		result=iTytle+"\n"+iData;
		
		
		return result;
		
	}
	
	public String toString_noTitle() {
		String result="---\t\t";
		String iData;
		iData=""+id+"\t\t";
		int k=0;
		for (Map.Entry<String, Object> entry : data.entrySet()) {
			if(k>0) {
				iData=iData+"\t";
			}
			iData=iData+entry.getValue();
			k+=1;
		}
		result=iData;
		
		
		return result;
		
	}
}
